package com.hznu.jspFinal.service;

import com.hznu.jspFinal.dao.ChoiceMapper;
import com.hznu.jspFinal.entity.Choice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ChoiceServiceImpl implements ChoiceService {
    @Autowired
    private ChoiceMapper choiceMapper;

    @Override
    public void insert(Choice choice) {
        choiceMapper.insert(choice);
    }

    @Override
    public void delete(Integer id) {
        choiceMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Choice selectById(Integer id) {
        return choiceMapper.selectByPrimaryKey(id);
    }

    @Override
    public void update(Choice choice) {
        choiceMapper.updateByPrimaryKey(choice);
    }

    @Override
    public Choice selectByContent(String content) {
        return choiceMapper.selectByContent(content);
    }
}
